using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Hotnet.Entity;
using Hotnet.Biz.NSBizCommon;

namespace Hotnet.Web.Controllers.Admin
{
	public class AdminLoginController : Controller
	{
		//
		// GET: /AdminLogin/
		private BizUser bizUser;
		public AdminLoginController(BizUser bizUser)
		{
			this.bizUser = bizUser;
		}

		public ActionResult Index()
		{
			return View();
		}

		[AcceptVerbs( HttpVerbs.Post)]
		public ActionResult Index(User user)
		{
			if (bizUser.Validate(user))
			{
				Session["_USER_"] = user.UserName;
				return RedirectToAction("index", "admin");
			}
			else
				return RedirectToAction("Index");
			//return new RedirectToRouteResult();
		}

	}
}
